package com.echat.messagesender.sender.service.impl;

import com.echat.messagesender.sender.email.EmailSenderManager;
import com.echat.messagesender.sender.bean.EchatSendEmailInfo;
import com.echat.messagesender.sender.email.bean.enumclass.EmailServerName;
import com.echat.messagesender.sender.service.EchatEmailSendService;
import com.echat.messagesender.sender.service.TemplateService;
import com.weibo.api.motan.config.springsupport.annotation.MotanService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by chenmohan on 2018/08/29
 *
 * @description
 */
@MotanService
public class EchatEmailSendServiceImpl implements EchatEmailSendService {

    @Autowired
    EmailSenderManager emailSenderManager;

    @Autowired
    TemplateService templateService;

    @Override
    public String printBean(EchatSendEmailInfo info){
        info.check();
        return info.toString();

    }

    @Override
    public Boolean sendEmail(EchatSendEmailInfo info) {
        info.check();
        return emailSenderManager.sendEmail(info);
    }

    @Override
    public Boolean sendEmail(EmailServerName type, EchatSendEmailInfo info) {
        return null;
    }

}
